mydir = "~/GitHub/functional_mediation/Simulations/Model_based_Simulation/gypsie/sfs_simulation/"

Results from simulation 1

Results from simulation 2

Results from simulation 3

Results from simulation 4

Plots with ggplot

load(paste0(mydir,dir(mydir)[grep("Simulation_1", dir(mydir))]))

alpha = A
beta  = B
gamma = CP
delta2 = d2
alphabeta = A*B

R = nrow(A)

for(i in 2:4){
  load(paste0(mydir,dir(mydir)[grep(paste0("Simulation_",i), dir(mydir))]))
  alpha = rbind(alpha, A)
  beta  = rbind(beta, B)
  gamma = rbind(gamma, CP)
  delta2 = rbind(delta2, CP)
  alphabeta = rbind(alphabeta, A*B)
}
par(mfrow=c(4,3))
for(i in 1:4){
  par(mar=c(1,1,2,1))
  matplot(t(alpha[((i-1)*R+1):(R*i),]), col = rgb(200,1,1, 30, maxColorValue = 255), type="l", main="Alpha", xlab="time (s)", ylab=NA)
  matplot(t(beta[((i-1)*R+1):(R*i),]), col = rgb(200,1,1, 30, maxColorValue = 255), type="l", main="Beta", xlab="time (s)", ylab=NA)
  matplot(t(alphabeta[((i-1)*R+1):(R*i),]), col = rgb(200,1,1, 30, maxColorValue = 255), type="l", main="Alpha*Beta", xlab="time (s)", ylab=NA)
}